<?php
header('Content-Type:text/html;charset=utf-8');
require('../public/zscg.php');
require('../public/local.php');
$uid=isset($_POST['uid'])?($_POST['uid']):'';
if(!$uid){
     echo "<script>alert('请先登录');window.location.href='/home/article.php'</script>";
    die;
}
$fid=$_POST['fid'];
$content=$_POST['editorValue'];
$ctime=time();
$arr=array('uid' => $uid,'fid' => $fid,'time' => $ctime,'content' => $content);
$res=insert($con,'pinglun',$arr);
if($res){
    echo "<script>window.location.href='/home/article.php?aid=$fid'</script>";
}else{
    echo "<script>alert('评论失败');window.location.href='/home/article.php?aid=$fid ?>'</script>";
}

